package com.ruoyi.manager.controller;


import com.ruoyi.manager.service.AnalysisTwoService;
import com.ruoyi.manager.service.TeachAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;

@RequestMapping("/manager/analysis")
@Controller
public class AnalysisController {

    @Autowired
    TeachAnalysisService teachAnalysisService;

    @Autowired
    AnalysisTwoService analysisTwoService;

    @RequestMapping()
    public String toTeachAnalysisPage(){
        return "redirect:/analysis/teachAnalysis.html";
    }

    @ResponseBody
    @RequestMapping("/listClssesInfo")
    public List<Map<String,Object>> listClassesInfor(){
        return teachAnalysisService.listClassesInfor();
    }

    //考核情况分析-饼图
    @ResponseBody
    @RequestMapping("/assessmentAnalysisPie")
    public List<Map<String,Object>> assessmentAnalysispie(){
        return teachAnalysisService.assessmentAnalysisPie();
    }

    //考核情况分析-漏斗图
    @ResponseBody
    @RequestMapping("/assessmentAnalysisfunnel")
    public List<Map<String,Object>> assessmentAnalysisfunnel(){
        return teachAnalysisService.assessmentAnalysisfunnel();
    }

    /**
     *     作业情况分析-完成率、提交率、完成率低于40%占比、完成率高于80%占比
     */
    @ResponseBody
    @RequestMapping("/exRate")
    public Map<String,Object> exRate(){
        return teachAnalysisService.exRate();
    }

    /**
     *     作业情况分析-柱状图
     */
    @ResponseBody
    @RequestMapping("/classSubAndFin")
    public List<Map<String,Object>> classSubAndFin(){
        return teachAnalysisService.classSubAndFin();
    }

    /**
     *     作业情况分析-本周核心作业完成率低于40%学员列表
     */
    @ResponseBody
    @RequestMapping("/studentsLt40")
    public List<Map<String,Object>> studentsLt40(){
        return teachAnalysisService.studentsLt40();
    }

    /**
     *     作业情况分析-本周核心作业完成率低于40%学员列表
     */
    @ResponseBody
    @RequestMapping("/countScoreAndAvg")
    public Map<String,Object> countScoreAndAvg(){
        return teachAnalysisService.countScoreAndAvg();
    }

    @ResponseBody
    @RequestMapping("/publishNum")
    public List<Map<String,Object>> publishNum(){
        return analysisTwoService.publishNum();
    }

    @ResponseBody
    @RequestMapping("/assessMent")
    public List<Map<String,Object>> assessMent(){
        return analysisTwoService.assessMent();
    }

    @ResponseBody
    @RequestMapping("/distriBution")
    public List<Map<String, Object>> distriBution(){
        return analysisTwoService.distriBution();
    }

    @ResponseBody
    @RequestMapping("/localMeg")
    public List<Map<String, Object>> localMeg(){
        return analysisTwoService.localMeg();
    }


}
